package com.example.controller;


import com.example.framwork.code.CodeConst;
import com.example.framwork.result.ProjectResult;
import com.example.utils.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@Slf4j
@RequestMapping("/shiro")
public class ShiroLoginController {

    @Autowired
    RedisUtil redisUtil;


    //登录操作
    @RequestMapping("/login")
    public ProjectResult login(String username, String password,HttpServletResponse response) {

         return new ProjectResult();
    }

    @RequestMapping("/adminGetUser")
    public String adminGetUser(String username,String password) {
        return "adminGetUser";
    }


    @RequestMapping("/userGet")
    public String userGet(String username,String password) {
        return "userGet";
    }


    @RequestMapping("/adminGet")
    public String adminGet(String username,String password) {
        return "adminGet";
    }


    @RequestMapping("/any")
    public String any(String username,String password) {
        return "any";
    }

    @GetMapping("/logout")
    public ProjectResult logout() {
        //SecurityUtils.getSubject().logout();
        return new ProjectResult();
    }

}
